package com.nf.health.app.inquiry.impl.viewholder;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.nf.health.app.R;
import com.nf.health.app.customview.MyDisucssView;
import com.nf.health.app.utils.ImageUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 *  用户的问诊医生
 * @author yyh
 */
public class DoctorIngerRogationViewLLHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
//    //下午的星星
//    @Bind(R.id.iv_mor_star01)
//    public ImageView iv_mor_star01;
//    @Bind(R.id.iv_mor_star02)
//    public ImageView iv_mor_star02;
//    @Bind(R.id.iv_mor_star03)
//    public ImageView iv_mor_star03;
//    @Bind(R.id.iv_mor_star04)
//    public ImageView iv_mor_star04;
//    @Bind(R.id.iv_mor_star05)
//    public ImageView iv_mor_star05;
//    @Bind(R.id.iv_mor_star06)
//    public ImageView iv_mor_star06;
//    @Bind(R.id.iv_mor_star07)
//    public ImageView iv_mor_star07;
//
//    //下午的星星
//    @Bind(R.id.iv_afn_star01)
//    public ImageView iv_afn_star01;
//    @Bind(R.id.iv_afn_star02)
//    public ImageView iv_afn_star02;
//    @Bind(R.id.iv_afn_star03)
//    public ImageView iv_afn_star03;
//    @Bind(R.id.iv_afn_star04)
//    public ImageView iv_afn_star04;
//    @Bind(R.id.iv_afn_star05)
//    public ImageView iv_afn_star05;
//    @Bind(R.id.iv_afn_star06)
//    public ImageView iv_afn_star06;
//    @Bind(R.id.iv_afn_star07)
//    public ImageView iv_afn_star07;
//
//
//    @Bind(R.id.ll_shoutip)//图片和布局的ll
//    public LinearLayout ll_shoutip;
//    @Bind(R.id.doctor_hospital_doc)//医院的名称
//    public TextView doctor_hospital_doc;
//    @Bind(R.id.tv_way_dcotail_interrogat)//出诊
//    public TextView tv_way_dcotail_interrogat;
//    @Bind(R.id.iv_star_dcotail_small)//展示title的小心星星
//    public ImageView iv_star_dcotail_small;
//    @Bind(R.id.iv_up_to_down)//展示想上或者是向下的箭头
//    public ImageView iv_up_to_down;
//    @Bind(R.id.ll_iv_up_to_down)//展示想上或者是向下的箭头
//    public LinearLayout ll_iv_up_to_down;
//    @Bind(R.id.ll_show_star)//展示上下的小星星
//    public LinearLayout ll_show_star;


    @Bind(R.id.ll_content_interrogation)//图片和布局的ll
    public LinearLayout ll_content_interrogation;

    private Context cnt;
    public DoctorIngerRogationViewLLHolder(View itemView, Context cnt) {
        super(itemView);
        ButterKnife.bind(this, itemView);
//        iv_up_to_down.setOnClickListener(this);
//        ll_shoutip.setOnClickListener(this);
        this.cnt = cnt;

    }
    public void onClick(View v) {
        switch (v.getId()){
//            case  R.id.iv_up_to_down:
//            case  R.id.ll_shoutip:
//                Integer tag = (Integer) iv_up_to_down.getTag();
//                if(tag == null){
//                    ImageUtils.setImageViewBg(iv_up_to_down, cnt, R.drawable.home_docinfo_more_up);
//                    if(ll_shoutip.getVisibility() == View.VISIBLE){
//                        iv_up_to_down.setTag(R.drawable.home_docinfo_more_up);
//                    }else{
//                        iv_up_to_down.setTag(R.drawable.home_docinfo_more_down);
//                    }
//                    tag = (Integer) iv_up_to_down.getTag();
//                }
//                if(tag == R.drawable.home_docinfo_more_down){
//                    ImageUtils.setImageViewBg(iv_up_to_down, cnt, R.drawable.home_docinfo_more_up);
//                    ll_shoutip.setVisibility(View.VISIBLE);
//                    ll_show_star.setVisibility(View.VISIBLE);
//                    iv_up_to_down.setTag(R.drawable.home_docinfo_more_up);
//                }else if(tag == R.drawable.home_docinfo_more_up){
//                    ImageUtils.setImageViewBg(iv_up_to_down, cnt, R.drawable.home_docinfo_more_down);
//                    ll_shoutip.setVisibility(View.GONE);
//                    ll_show_star.setVisibility(View.GONE);
//                    iv_up_to_down.setTag(R.drawable.home_docinfo_more_down);
//                }
//                break;
        }
    }
        public void loadData(List<HashMap<String,String>> list){
            ll_content_interrogation.removeAllViews();
            if(list == null){
                return ;
            }
            for(int i = 0 ; i < list.size(); i++){
                HashMap<String,String> hworkTimeMap = list.get(i);
                MyDisucssView myDisucssView = new MyDisucssView(cnt,i);
                //myDisucssView.setMorningStar();// 绘制上午的小星星
                //myDisucssView.setAfternoonStar();//绘制下午的小星星
                myDisucssView.setPositionStar(hworkTimeMap);//小星星
                myDisucssView.setHospitalName(hworkTimeMap.get("hospitalname"));//绘制医院的名称
                ll_content_interrogation.addView(myDisucssView);
        }
    }
}
